/* 基础样式和主题颜色 */
:root {
    --primary-color: #1677ff;
    --primary-light: #e6f4ff;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --error-color: #ff4d4f;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --border-radius: 6px;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* 全局样式优化 */
#question-generation-app {
    font-family: var(--font-family);
}

#question-generation-app .card {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border: none;
}

#question-generation-app .card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* 表单样式优化 */
#question-generation-app .form-control,
#question-generation-app .form-select,
#question-generation-app .amis-select {
    border-radius: var(--border-radius);
    transition: var(--transition);
}

#question-generation-app .form-control:focus,
#question-generation-app .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.2);
}

/* 按钮样式优化 */
#question-generation-app .btn {
    border-radius: var(--border-radius);
    transition: var(--transition);
    padding: 8px 16px;
    font-weight: 500;
}

#question-generation-app .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

#question-generation-app .btn-primary:hover {
    background-color: #0958d9;
    border-color: #0958d9;
    transform: translateY(-1px);
}

/* 确保不同状态下容器的显示 */
#question-generation-app:not(.status-generating) [data-status="generating"] {
    display: none !important;
}

#question-generation-app:not(.status-completed) [data-status="completed"] {
    display: none !important;
}

#question-generation-app:not(.status-error) [data-status="error"] {
    display: none !important;
}

#question-generation-app:not(.status-waiting) [data-status="waiting"] {
    display: none !important;
}

/* 针对生成中状态的进度样式 */
#question-generation-app.status-generating [data-status="generating"] {
    display: block !important;
}

/* 进度条动画效果 */
.generation-progress .progress-bar {
    transition: width 0.5s ease;
    background-image: linear-gradient(45deg, 
        rgba(255, 255, 255, 0.15) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255, 255, 255, 0.15) 50%, 
        rgba(255, 255, 255, 0.15) 75%, 
        transparent 75%, 
        transparent);
    background-size: 1rem 1rem;
    animation: progress-bar-stripes 1s linear infinite, progress-pulse 2s infinite;
}

@keyframes progress-bar-stripes {
    from { background-position: 1rem 0; }
    to { background-position: 0 0; }
}

@keyframes progress-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* 生成日志区域样式 */
.bg-dark.text-light {
    max-height: 300px;
    overflow-y: auto;
    border-radius: var(--border-radius);
    background-color: #272b30 !important;
}

/* 确保日志项目间的分隔 */
.bg-dark.text-light div {
    padding: 4px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
}

/* 状态相关的颜色 */
.status-generating .progress-stage {
    color: var(--primary-color);
    font-weight: bold;
}

/* 主题化面板和卡片 */
#question-generation-app .panel-default,
#question-generation-app .panel {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

#question-generation-app .panel-heading,
#question-generation-app .panel-default > .panel-heading {
    background-color: #f8f9fa;
    border-bottom: 1px solid #f0f0f0;
    padding: 12px 16px;
}

#question-generation-app .panel-body {
    padding: 16px;
}

/* 美化等待状态 */
.waiting-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: #8c8c8c;
}

.waiting-container .waiting-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: #d9d9d9;
    transition: var(--transition);
}

.waiting-container:hover .waiting-icon {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* 美化生成结果表格 */
.generated-questions-table {
    margin-top: 16px;
}

.generated-questions-table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.generated-questions-table tr:hover {
    background-color: var(--primary-light);
}

/* 自适应设计 */
@media (max-width: 768px) {
    #question-generation-app .grid-row {
        flex-direction: column;
    }
    
    #question-generation-app .grid-col {
        width: 100% !important;
        margin-bottom: 16px;
    }
    
    #question-generation-app .card {
        margin-bottom: 16px;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 题目卡片样式 */
.question-card {
    border-left: 3px solid var(--primary-color);
    transition: var(--transition);
}

.question-card:hover {
    transform: translateY(-2px);
}

/* 状态标签样式 */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge-success {
    background-color: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.status-badge-processing {
    background-color: #e6f4ff;
    border: 1px solid #91caff;
    color: #1677ff;
}

.status-badge-error {
    background-color: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
} 